package com.huike.review.service.impl;

import com.huike.review.pojo.Review;
import com.huike.review.service.ReviewService;
import com.huike.review.mapper.MybatisReviewMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * mybatis复习使用的业务层
 * 注意该业务层和我们系统的业务无关，主要是让同学们快速熟悉系统的
 */
@Service
public class ReviewServiceImpl implements ReviewService {

    @Autowired
    private MybatisReviewMapper reviewMapper;

    @Override
    public void add(Review review) {
        reviewMapper.add(review);
    }

    @Override
    public void deleteById(int id) {
        reviewMapper.deleteById(id);
    }

    @Override
    public void updateById(Review review) {
        reviewMapper.updateById(review);
    }

    @Override
    public Review selectById(int id) {
        Review select = reviewMapper.selectById(id);
        return select;
    }
}